package com.ruoyi.common.core.enums;

/**
 * 启用状态
 * 
 * @author fkmalls
 */
public enum DelFlagEnum
{
    OK("0", "正常"), DEL("1", "删除");

    private final String code;
    private final String name;

    DelFlagEnum(String code, String name)
    {
        this.code = code;
        this.name = name;
    }

    public String getCode()
    {
        return code;
    }

    public String getName()
    {
        return name;
    }

    public static String getNameByCode(Integer code) {
        for (DelFlagEnum item : DelFlagEnum.values()) {
            if (item.getCode().equals(code)) {
                return item.getName();
            }
        }
        return "";
    }

    public static String getCodeByName(String name) {
        for (DelFlagEnum item : DelFlagEnum.values()) {
            if (item.getName().equals(name)) {
                return item.code;
            }
        }
        return null;
    }
}
